package org.NooLab.itexx.app.gui.handlers;

import java.awt.Component;

import javax.swing.JTextArea;


import org.NooLab.utilities.logging.PrintLog;




public class CliccCounter {
	
	

	private DoubleClicked doubleClicked=null;

	int clics=0;
	PrintLog out = new PrintLog(2,false);
	
	// ========================================================================
	public CliccCounter (){
		
	}
	// ========================================================================
	
	
	public int detect(Component textArea) {// JTextArea
	
		if (doubleClicked==null){
			doubleClicked = new DoubleClicked(textArea);
			out.print(2, "jTextAreaFileDrop DOUBLE-CLICK checking started....");
			clics=1;
		}else{
			if (doubleClicked.isDoubleClicked()){
				doubleClicked.close();
				doubleClicked = null;
				
				out.print(2, "jTextAreaFileDrop DOUBLE-CLICK received");
				
				clics=2;
			}
		}

		return clics;
	}


 

}
